package com.boco.transnms.server.bo.workflow;

import com.boco.common.util.except.*;

import com.boco.transnms.common.dto.base.*;
import com.boco.transnms.server.bo.base.*;
import com.boco.transnms.server.bo.ibo.workflow.*;
import com.boco.transnms.server.dao.base.*;
import com.boco.transnms.server.dao.workflow.*;
import com.boco.common.util.db.UserTransaction;
import com.boco.transnms.common.dto.SystemPara;

/**
 * <p>Title: </p>
 *
 * <p>Description: WebMaster4.x</p>
 *
 * <p>Copyright: Copyright (c) 2005</p>
 *
 * <p>Company: BOCO</p>
 *
 * @author not attributable
 * @version 4.2.x
 */
public class AttempSystemParaBO extends AbstractBO implements IAttempSystemParaBO {
    public AttempSystemParaBO() {
    }

    public DboCollection getAttempSystemPara(BoActionContext actionContext) throws UserException {
        try {
            return getAttempSystemParaDAO().getAttempSystemPara(actionContext);
        } catch (Throwable ex) {
            throw new UserException(ex);
        }
    }

    public void modifyAttempSystemParas(BoActionContext actionContext, SystemPara[] dbos) throws UserException {
        try {
            UserTransaction trx = com.boco.common.util.db.TransactionFactory.getInstance().createTransaction();
            try {
                trx.begin();
                getAttempSystemParaDAO().modifyAttempSystemParas(actionContext, dbos);
                trx.commit();
            } catch (Throwable ex) {
                trx.rollback();
                throw new UserException(ex);
            }
        } catch (Exception ex) {
            throw new UserException(ex);
        }
    }

    public void modifyAttempSysPara(BoActionContext actionContext,SystemPara[] sysParas) throws Exception {
        getAttempSystemParaDAO().modifyAttempSysPara(actionContext,sysParas);
    }

    public SystemPara getSystemPara(BoActionContext actionContext, String productSp, String paraName) throws UserException {
        try {
            return getAttempSystemParaDAO().getSystemPara(actionContext, productSp, paraName);
        } catch (Exception ex) {
            return null;
        }
    }

    public AttempSystemParaDAO getAttempSystemParaDAO() {
        return (AttempSystemParaDAO)super.getDAO(DaoName.AttempSystemParaDAO);
    }
}
